-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storage: row ID generation for MVCC bitmap filter #6458
Storage: row ID generation for MVCC bitmap filter #6458
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-all-tests |
dbms/src/Storages/DeltaMerge/DMVersionFilterBlockInputStream.cpp
Outdated
Show resolved
Hide resolved
auto [read_offset, read_rows] = column_file_reader->readRows(output_columns, rows_start_in_file, rows_in_file_limit, range); | ||
actual_read += read_rows; | ||
if (row_ids != nullptr) | ||
{ | ||
auto rows_before_cur_file = file_index == 0 ? 0 : column_file_rows_end[file_index - 1]; | ||
auto start_row_id = read_offset + rows_before_cur_file; | ||
for (size_t i = 0; i < read_rows; ++i) | ||
{ | ||
row_ids->push_back(start_row_id + i); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usually, when MVCC, the remaining rows are more than the filter-out rows, maybe we can record the filter-out row_id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After reading here also need to go to the upper layer for calculation, record the filter-out row_id does not meet the current logic.
09c8536
to
d9f64e7
Compare
/run-all-tests |
/build |
/run-integration-test |
dbms/src/Storages/DeltaMerge/BitmapFilter/BitmapFilterBlockInputStream.cpp
Outdated
Show resolved
Hide resolved
10bf844
to
7b5f213
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is mixed with bitmap logic now.
auto & segment_snap = bitmap_filter->snapshot(); | ||
auto enable_handle_clean_read = !hasColumn(columns_to_read, EXTRA_HANDLE_COLUMN_ID); | ||
constexpr auto is_fast_scan = true; | ||
auto enable_del_clean_read = !hasColumn(columns_to_read, TAG_COLUMN_ID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think enable_del_clean_read
is always false. TiDB Planner is not aware of the tag column, so columns_to_read never contain tag column.
3f0e3a5
to
98f728f
Compare
/run-all-tests |
/run-unit-tests |
03ceb6b
to
f8a3bc3
Compare
bb20cd3
to
220b51b
Compare
/run-all-tests |
/run-all-tests |
/run-integration-test |
dbms/src/Storages/DeltaMerge/BitmapFilter/BitmapFilterBlockInputStream.h
Show resolved
Hide resolved
BlockInputStreamPtr stream = segment_snap->stable->getInputStream(dm_context, | ||
columns_to_read, | ||
read_ranges, | ||
filter, | ||
max_version, | ||
expected_block_size, | ||
/*enable_handle_clean_read*/ false, | ||
/*is_fast_scan*/ false, | ||
/*enable_del_clean_read*/ false, | ||
/*read_packs*/ some_packs, | ||
/*need_row_id*/ true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is worth to do this now. We do not need to createSegmentRowIdCol
in ConcatSkippableBlockInputStream
. When the parent of ConcatSkippableBlockInputStream
is DeltaMergeBlockInputStream
, there is no need to createSegmentRowIdCol
since DeltaMergeBlockInputStream
will do that. And the parent of ConcatSkippableBlockInputStream
is DMRowKeyFilterBlockInputStream
, we can call read(FilterPtr, true)
to return filter, and we can use filter to generate bitmap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The others LGTM. We can add some comments about previous discussion. Leave it to be optimized.
Can you write an issue about it? @Lloyd-Pottiger |
/run-all-tests |
ok, I will open an issue after this pr merged. |
/merge |
@JinheLin: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 097d928
|
ref pingcap#6296 Signed-off-by: ywqzzy <[email protected]>
What problem does this PR solve?
Issue Number: ref #6296
Problem Summary:
Segment::getInputStream
can obtain an ordered data stream.SegmentRowIdCol
.SegmentRowIdCol
, the read interfaces of Delta and Stable need to return the 'row position' of returned data.What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note